<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\ApiController;
use App\Services\HomeTemplates\HomeService;

/**
 * Class HomeController
 * @package App\Http\Controllers\Api\V1
 */
class HomeController extends ApiController
{

    /**
     * @var HomeService
     */
    protected $homeService;

    /**
     * HomeController constructor.
     * @param HomeService $homeService
     */
    public function __construct(HomeService $homeService)
    {
        $this->homeService = $homeService;
    }

    /**
     * 获取首页数据
     * @author Jerry
     * @param int $id
     * @param int $isShow
     * @return mixed
     */
    public function index(int $id, int $isShow = 0)
    {
        $data = $this->homeService->handle($id, $isShow);

        return $this->status('success', $data);
    }
}
